From 782f9a4a8e801b2077f1775a85cc5950bdd6acdf Mon Sep 17 00:00:00 2001
From: Thomas Preud'homme <robotux@celest.fr>
Date: Sun, 17 Feb 2013 23:39:08 +0100
Subject: Disable stack protector in runtime library

tcc fails to run when compiled by itself and its runtime library was
built with any variant of -fstack-protector. This is why test3 fails
when libtcc1.a is build with -fstack-protector.

Origin: vendor
Forwarded: no
Last-Update: 2018-02-24
---
 lib/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/Makefile b/lib/Makefile
index bc57be7f..2fad34a6 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -24,6 +24,7 @@ arm-libtcc1-usegcc ?= no
 #x86_64-libtcc1-usegcc=yes
 #i386-libtcc1-usegcc=yes
 
+CFLAGS:=$(CFLAGS) -fno-stack-protector
 ifeq "$($(T)-libtcc1-usegcc)" "yes"
  XCC = $(CC)
  XAR = $(AR)
